<div id="screen"></div>
<!--邀请好友弹出-->
<div class="inventAlt">
    <div class="inventTit">
        <img src="{TEST_STATIC_PATH}new_beilai/images/inventTit.png" >
    </div>
    <div class="shareBox">
        <p>{$config['pageshare_txt']}</p>
        <img src="" id="poster_img" style="width: 3.5rem;">
        <span>长按保存图片</span>
        <div class="shareBtn">
            <a href="javascript:void(0);" class="copySend" onclick="copyTXT()">一键复制发圈配文</a>
            <a href="javascript:void(0);" class="sendLink">点击右上角分享给好友</a>
        </div>
    </div>
</div>


<!--在线客服-->
<div class="online">
    <h2>
        在线客服
        <span class="closeOnlie"></span>
    </h2>
    <div class="lessonTop">
        <div class="lessonBrand">
            <img src="{TEST_STATIC_PATH}new_beilai/images/user.png">
        </div>
        <div class="brandTxt">
            <p>在线客服</p>
            <span>{$kefu['mobile']}</span>
        </div>
        <a href="tel:{$kefu['mobile']}" class="brandTel"></a>
    </div>
    {if $kefu['qr_code']}
    <div class="contactEwm">
        <img src="{$kefu['qr_code']}" >
        <p>长按识别二维码联系我们</p>
    </div>
    {/if}
    {if $company_info}
    <div class="contactInfor">
        <h3>{$company_info['name']}</h3>
        <ul>
            <li>
                <p>地址</p>
                <span>{php echo json_decode($company_info['address'],true)[0];}</span>
                <a href="" class="goMap">导航</a>
            </li>
            <li>
                <p>电话</p>
                <span>{php echo $company_info['mobile'];}</span>
                <a href="" class="goTel">拨号</a>
            </li>
        </ul>
    </div>
    {/if}
</div>

<script>
    function showPoster(){
        let waittips="{$poster_info['tips']}";
        let url="{$poster_info['img_url']}";
        if (waittips!=''){
            layer.msg(waittips);
        }
        if (waittips!='海报未开启' && waittips!='成功购买课程后，才能生成海报'){

            $.ajax({
                type:'POST',
                data:{},
                dataType : "json",
                url:url,
                success:function(data){
                    var data = data.message;
                    if(data.errcode == 0){
                        $("#poster_img").attr("src",data.img)
                        $('#screen').fadeIn();
                        $('.inventAlt').animate({'bottom':0},500)
                    }else{
                        layer.msg(data.msg);
                    }
                }
            });
        }
    }
    function hideService(){
        $(".service").hide();
    }
    function copyTXT() {
        try {
            let range = document.createRange();
            range.selectNode(document.getElementById("poster_txt"));
            window.getSelection().removeAllRanges();
            window.getSelection().addRange(range);
            document.execCommand('copy');
            window.getSelection().removeAllRanges();
            layer.msg('复制成功');
        } catch (e) {
            layer.msg('复制失败');
        }
    }
    function showService() {
        $('#screen,.online').fadeIn();
    }
    //客服弹出
    $('.kf').click(function(){
        console.log(123123)
    })
    $('.closeOnlie').click(function(){
        $('#screen,.online').fadeOut();
    })
    $('#screen').click(function(){
        $('#screen').fadeOut();
        $('.paySuccess').fadeOut();
        $('.inventAlt').animate({'bottom':'-150%'},500)
    })
</script>